package LeetCode.month01.day25;

public class No326 {
    public boolean isPowerOfThree(int n) {
        if(n<=0) return false;
        while(n>0){
            if(n%3!=0&&n!=1) return false;
            n/=3;
        }
        return true;
    }
}
